package com.yanqu.road.server.cmd.activity.zhenhuan.second;

import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ZhenHuanProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.activity.zhenhuan.CrossZhenHuanMgr;
import com.yanqu.road.server.manager.activity.zhenhuan.CrossZhenHuanSecondActivity;
import com.yanqu.road.server.manager.user.CrossUserMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_CROSS_ZHENHUAN_SECOND_PROCESS_MY_PARTY_LIST, desc = "我的茶话会")
public class CrossZhenHuanSecondProcessMyPartyCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        ZhenHuanProto.ZhenHuanSecondProcessMyPartyListReqMsg reqMsg = ZhenHuanProto.ZhenHuanSecondProcessMyPartyListReqMsg.parseFrom(packet.getBytes());
        CrossZhenHuanSecondActivity secondActivity = CrossZhenHuanMgr.getSecondActivity(reqMsg.getActivityId());
        if (secondActivity == null) {
            return;
        }

        ZhenHuanProto.ZhenHuanSecondProcessMyPartyListRespMsg.Builder respMsg = secondActivity.getMyPartyListMsg(packet.getPlayerId(), reqMsg.getPage(), reqMsg.getPageSize(), reqMsg.getTapType());

        MessageHelper.sendPacket(serverId, packet.getPlayerId(),
                YanQuMessageUtils.buildMessage(ClientProtocol.U_ZHENHUAN_SECOND_PROCESS_MY_PARTY_LIST, respMsg));
    }

    @Override
    public void sendData() {

    }
}
